﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dln.Model;
using Dln.Common.Helper;
using System.IO;

public partial class Index : BasePage
{
    protected string userName = string.Empty;
    protected void Page_Load(object sender, EventArgs e)
    {
        GetLeftMenu();
        HttpCookie userCookie = HttpContext.Current.Request.Cookies["LoginInfo"];
        if (userCookie != null)
        {
            if (userCookie["UserName"] != null)
            {
                var uptModel = SqlHelper.Context.From<Employee>().Where(d => d.Phone == userCookie["UserName"]).ToFirstDefault();
                if (uptModel != null)
                {
                    userName = uptModel.EmployeeName;
                }
            }
        }
    }


    /// <summary>
    /// 绘制首页菜单
    /// </summary>
    private void GetLeftMenu()
    {
        //"\"name\": \"任务中心\", " +
        //string str = File.ReadAllText(@"c:\temp\ascii.txt");
        //string str = File.ReadAllText(@"E:\Test\Com\Menuson.json");
        string str = File.ReadAllText(@"C:\新建文件夹\Admin\Com\Menuson.json");
        this.hdMenu.Value = str;
    }
}